package com.enjoyor.soa.traffic.core.efoms.mapper.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.processing.SupportedSourceVersion;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.enjoyor.soa.traffic.core.efoms.constant.SurveyDeviceInfoSqlId;
import com.enjoyor.soa.traffic.core.efoms.domain.SurveyDeviceInfo;
import com.enjoyor.soa.traffic.core.efoms.mapper.ISurveyDeviceInfoMapper;
import com.enjoyor.soa.traffic.frame.support.mybatis.mapper.impl.BaseMapper;
import com.enjoyor.soa.traffic.util.pojo.Page;

@Service
@Transactional
public class SurveyDeviceInfoMapper extends BaseMapper<SurveyDeviceInfo> implements ISurveyDeviceInfoMapper{

	@Override
	public List<SurveyDeviceInfo> getSurveyDeviceInfoList(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectList(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_LIST), map);
	}

	@Override
	public Page getSurveyDeviceInfoPage(Page page) {
		// TODO Auto-generated method stub
		return this.selectPageInfo(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_ALL), page);
	}
	

	@Override
	public int getInterUnNormalCount(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectOne(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_INTER_COUNT),map);
	}

	@Override
	public int getDataUnNormalCount(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectOne(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_DATA_COUNT),map);
	}

	@Override
	public int getworkerOrdersUnNormalCount(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectOne(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_WORKERORDERS_UNNOR_COUNT),map);
	}

	@Override
	public int getRepairFlautCount(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectOne(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_REPAIRS_FAULT_COUNT),map);
	}

	@Override
	public int getDeviceTotalSum(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectOne(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_DEV_TOTALSUM),map);
	}

	@Override
	public int getPicMonitorFlautCount(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectOne(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_PICMONITOR_FAULT_COUNT),map);
	}

	@Override
	public int getWarnFaultCount(Map<String, Object> map){
		return sqlSessionTemplate.selectOne(getSqlName(SurveyDeviceInfoSqlId.SQL_SELECT_WARN_FAULT_COUNT),map);
	}

}
